home *** CD-ROM | disk | FTP | other *** search
/ Belgian Amiga Club - ADF Collection / BS1 part 65.zip / BS1 part 65 / DevPac v3.02b.adf / include / graphics / gels.i < prev    next >
Text File  |  1991-11-20  |  9KB  |  205 lines

  1.     IFND    GRAPHICS_GELS_I
  2. GRAPHICS_GELS_I SET    1
  3. **
  4. **    $Filename: graphics/gels.i $
  5. **    $Release: 1.3 $
  6. **
  7. **    include file for AMIGA GELS (Graphics Elements) 
  8. **
  9. **    (C) Copyright 1985,1986,1987,1988 Commodore-Amiga, Inc.
  10. **        All Rights Reserved
  11. **
  12.  
  13. *------ VS_vSflags ---------------------------------------------------
  14.  
  15. *   ;-- user-set vSprite flags --
  16. SUSERFLAGS  EQU $00FF          ; mask of all user-settable vSprite-flags
  17.     BITDEF  VS,VSPRITE,0      ; set if vSprite, clear if bob
  18.     BITDEF  VS,SAVEBACK,1     ; set if background is to be saved/restored
  19.     BITDEF  VS,OVERLAY,2      ; set to mask image of bob onto background
  20.     BITDEF  VS,MUSTDRAW,3     ; set if vSprite absolutely must be drawn
  21. *   ;-- system-set vSprite flags --
  22.     BITDEF  VS,BACKSAVED,8    ; this bob's background has been saved
  23.     BITDEF  VS,BOBUPDATE,9    ; temporary flag, useless to outside world
  24.     BITDEF  VS,GELGONE,10     ; set if gel is completely clipped (offscreen)
  25.     BITDEF  VS,VSOVERFLOW,11  ; vSprite overflow (if MUSTDRAW set we draw!)
  26.  
  27.  
  28. *------ B_flags ------------------------------------------------------
  29. *   ;-- these are the user flag bits --
  30. BUSERFLAGS  EQU $00FF          ; mask of all user-settable bob-flags
  31.     BITDEF  B,SAVEBOB,0          ; set to not erase bob
  32.     BITDEF  B,BOBISCOMP,1     ; set to identify bob as animComp
  33. *   ;-- these are the system flag bits --
  34.     BITDEF  B,BWAITING,8      ; set while bob is waiting on 'after'
  35.     BITDEF  B,BDRAWN,9          ; set when bob is drawn this DrawG pass
  36.     BITDEF  B,BOBSAWAY,10     ; set to initiate removal of bob
  37.     BITDEF  B,BOBNIX,11          ; set when bob is completely removed
  38.     BITDEF  B,SAVEPRESERVE,12 ; for back-restore during double-buffer
  39.     BITDEF  B,OUTSTEP,13      ; for double-clearing if double-buffer
  40.  
  41.  
  42. *------ defines for the animation procedures -------------------------
  43.  
  44. ANFRACSIZE  EQU 6
  45. ANIMHALF    EQU $0020
  46. RINGTRIGGER EQU $0001
  47.  
  48. *------ macros --------------------------------------------------------
  49. * these are GEL functions that are currently simple enough to exist as a
  50. * definition.  It should not be assumed that this will always be the case
  51.  
  52. InitAnimate MACRO   * &animKey
  53.        CLR.L   \1
  54.        ENDM
  55.  
  56.  
  57. RemBob        MACRO   * &b
  58.        OR.W    #BF_BOBSAWAY,b_BobFlags+\1
  59.        ENDM
  60.  
  61. *------ VS : vSprite -------------------------------------------------
  62.  STRUCTURE  VS,0    ; vSprite
  63. *   -- SYSTEM VARIABLES --
  64. *   GEL linked list forward/backward pointers sorted by y,x value
  65.     APTR    vs_NextVSprite    ; struct *vSprite
  66.     APTR    vs_PrevVSprite    ; struct *vSprite
  67. *   GEL draw list constructed in the order the bobs are actually drawn, then
  68. *   list is copied to clear list
  69. *   must be here in vSprite for system boundary detection
  70.     APTR    vs_DrawPath          ; struct *vSprite: pointer of overlay drawing
  71.     APTR    vs_ClearPath      ; struct *vSprite: pointer for overlay clearing
  72. *   the vSprite positions are defined in (y,x) order to make sorting
  73. *   sorting easier, since (y,x) as a long integer
  74.     WORD    vs_Oldy          ; previous position
  75.     WORD    vs_Oldx          ;
  76. *   -- COMMON VARIABLES --
  77.     WORD    vs_VSFlags          ; vSprite flags
  78. *   -- USER VARIABLES --
  79. *    the vSprite positions are defined in (y,x) order to make sorting
  80. *    easier, since (y,x) as a long integer
  81.     WORD    vs_Y          ; screen position
  82.     WORD    vs_X
  83.     WORD    vs_Height
  84.     WORD    vs_Width          ; number of words per row of image data
  85.     WORD    vs_Depth          ; number of planes of data
  86.     WORD    vs_MeMask          ; which types can collide with this vSprite
  87.     WORD    vs_HitMask          ; which types this vSprite can collide with
  88.     APTR    vs_ImageData      ; *WORD pointer to vSprite image
  89. *    borderLine is the one-dimensional logical OR of all
  90. *    the vSprite bits, used for fast collision detection of edge
  91.     APTR    vs_BorderLine     ; *WORD: logical OR of all vSprite bits
  92.     APTR    vs_CollMask          ; *WORD: similar to above except this is a 
  93. *    matrix pointer to this vSprite's color definitions (not used by bobs)
  94.     APTR    vs_SprColors      ; *WORD
  95.     APTR    vs_VSBob          ; struct *bob: points home if this vSprite is 
  96.                   ;     part of a bob
  97. *    planePick flag:  set bit selects a plane from image, clear bit selects
  98. *      use of shadow mask for that plane
  99. *    OnOff flag: if using shadow mask to fill plane, this bit (corresponding
  100. *      to bit in planePick) describes whether to fill with 0's or 1's
  101. *    There are two uses for these flags:
  102. *           - if this is the vSprite of a bob, these flags describe how 
  103. *         the bob is to be drawn into memory
  104. *           - if this is a simple vSprite and the user intends on setting 
  105. *         the MUSTDRAW flag of the vSprite, these flags must be set 
  106. *         too to describe which color registers the user wants for 
  107. *         the image
  108.     BYTE    vs_PlanePick
  109.     BYTE    vs_PlaneOnOff
  110.     LABEL   vs_SUserExt          ; user definable
  111.     LABEL   vs_SIZEOF
  112.  
  113.  
  114. *------ BOB : bob ------------------------------------------------------
  115.  
  116.  STRUCTURE  BOB,0     ; bob: blitter object
  117. *   -- COMMON VARIABLES --
  118.     WORD    bob_BobFlags      ; general purpose flags (see definitions below)
  119. *   -- USER VARIABLES --
  120.     APTR    bob_SaveBuffer    ; *WORD pointer to the buffer for background 
  121. *    save used by bobs for "cookie-cutting" and multi-plane masking
  122.     APTR    bob_ImageShadow   ; *WORD
  123. *    pointer to BOBs for sequenced drawing of bobs
  124. *      for correct overlaying of multiple component animations
  125.     APTR    bob_Before          ; struct *bob: draw this bob before bob pointed
  126.                   ; to by before
  127.     APTR    bob_After          ; struct *bob: draw this bob after bob pointed
  128.                   ; to by after
  129.     APTR    bob_BobVSprite    ; struct *vSprite: this bob's vSprite definition
  130.     APTR    bob_BobComp          ; struct *animComp: pointer to this bob's 
  131.                   ; animComp def
  132.     APTR    bob_DBuffer          ; struct dBufPacket: pointer to this bob's 
  133.                   ; dBuf packet
  134.     LABEL   bob_BUserExt      ; bob user extension
  135.     LABEL   bob_SIZEOF
  136.  
  137. *------ AC : animComp ------------------------------------------------
  138.  
  139.  STRUCTURE  AC,0    ; animComp
  140. *   -- COMMON VARIABLES --
  141.     WORD    ac_CompFlags      ; animComp flags for system & user
  142. *    timer defines how long to keep this component active:
  143. *      if set non-zero, timer decrements to zero then switches to nextSeq
  144. *      if set to zero, animComp never switches
  145.     WORD    ac_Timer
  146. *   -- USER VARIABLES --
  147. *    initial value for timer when the animComp is activated by the system
  148.     WORD    ac_TimeSet
  149. *    pointer to next and previous components of animation object
  150.     APTR    ac_NextComp          ; struct *animComp
  151.     APTR    ac_PrevComp          ; struct *animComp
  152. *    pointer to component component definition of next image in sequence
  153.     APTR    ac_NextSeq          ; struct *animComp
  154.     APTR    ac_PrevSeq          ; struct *animComp
  155.     APTR    ac_AnimCRoutine   ; address of special animation procedure
  156.     WORD    ac_YTrans          ; initial y translation (if this is a component)
  157.     WORD    ac_XTrans          ; initial x translation (if this is a component)
  158.     APTR    ac_HeadOb          ; struct *animOb
  159.     APTR    ac_AnimBob          ; struct *bob
  160.     LABEL   ac_SIZE
  161.  
  162. *------ AO : animOb --------------------------------------------------
  163.  
  164.  STRUCTURE  AO,0    ; animOb
  165. *   -- SYSTEM VARIABLES --
  166.     APTR    ao_NextOb          ; struct *animOb
  167.     APTR    ao_PrevOb          ; struct *animOb
  168. *    number of calls to Animate this animOb has endured
  169.     LONG    ao_Clock
  170.     WORD    ao_AnOldY          ; old y,x coordinates
  171.     WORD    ao_AnOldX          ;
  172. *   -- COMMON VARIABLES --
  173.     WORD    ao_AnY          ; y,x coordinates of the animOb
  174.     WORD    ao_AnX          ;
  175. *   -- USER VARIABLES --
  176.     WORD    ao_YVel          ; velocities of this object
  177.     WORD    ao_XVel          ;
  178.     WORD    ao_XAccel          ; accelerations of this object
  179.     WORD    ao_YAccel          ;      !!! backwards !!!
  180.     WORD    ao_RingYTrans     ; ring translation values
  181.     WORD    ao_RingXTrans     ;
  182.     APTR    ao_AnimORoutine   ; address of special animation procedure
  183.     APTR    ao_HeadComp          ; struct *animComp: pointer to first component
  184.     LABEL   ao_AUserExt          ; animOb user extension
  185.     LABEL   ao_SIZEOF
  186.  
  187.  
  188. *------ DBP : dBufPacket ---------------------------------------------
  189. * dBufPacket defines the values needed to be saved across buffer to buffer
  190. *   when in double-buffer mode
  191.  
  192.  STRUCTURE  DBP,0          ; dBufPacket
  193.     WORD    dbp_BufY          ; save the other buffers screen coordinates
  194.     WORD    dbp_BufX          ;
  195.     APTR    dbp_BufPath          ; struct *vSprite: carry the draw path over
  196.                   ; the gap
  197. *    these pointers must be filled in by the user
  198. *    pointer to other buffer's background save buffer
  199.     APTR    dbp_BufBuffer     ; *WORD
  200. *    pointer to other buffer's background plane pointers
  201.     APTR    dbp_BufPlanes     ; **WORD
  202.     LABEL   dbp_SIZEOF
  203.  
  204.     ENDC    ; GRAPHICS_GELS_I
  205.